<template>
  <div>
    <!-- 1-->
    <mySection
      v-for="(item, i) in classlist"
      :key="i"
      :item="item"
      @gotoDetail="gotoDetail"
    ></mySection>
    <div class="foot">没有更多了</div>
  </div>
</template>

<script>
import mySection from "../../components/class/mySection.vue";
import { getClass } from "../../utils/api";
export default {
  name: "Class",
  data() {
    return {
      classlist: [],
    };
  },
  created() {
    getClass().then((res) => {
      // console.log(res);
      this.classlist = res.data.list;
    });
  },
  methods: {
    gotoDetail(id) {
      // console.log(item);
      this.$router.push({ path: "/classDetail", query: { id } });
    },
  },
  components: {
    mySection,
  },
};
</script>

<style lang="scss" scoped>
.foot {
  height: 80px;
  padding: 30px;
  text-align: center;
  align-items: center;
  background-color: #f7f8fa;
  color: #8c8c8c;
}
</style>